#include <stdio.h>

#define key_dbg printf

uint16_t key1cnt = 0;
uint16_t key2cnt = 0;
uint16_t key3cnt = 0;

void bspkey_detect(uint8_t key1, uint8_t key2) {

    uint8_t keyval = key1 | key2 
	if( (0 != key1) && (0 != key2) ) {
        key3cnt++;
        key1cnt = 0;
        key2cnt = 0;
    }else {
        if(key3cnt > 500) {
            key_dbg("key3\n");
        }
        key3cnt = 0;
        
        if ( 0 != key1 ) {
            key1cnt++;
        }else {
            if( key1cnt > 300 ) {
                key_dbg("key1 long \n");
            }else if( key1cnt > 15 ) {
                key_dbg("key1 short \n");
            }
            key1cnt = 0;
        }

        if ( 0 != key2 ) {
            key2cnt++;
        }else {
            if( key2cnt > 300 ) {
                key_dbg("key2 long \n");
            }else if( key2cnt > 15 ) {
                key_dbg("key2 short \n");
            }
            key2cnt = 0;
        }
    }

 

	
}

int main(void) {
    

}


